<template>
	<view class="withdraw">
		<view class="list" v-if="list.length > 0">
			<view class="uni-card" v-for="(item, index) in list" :key="index">
				<view class="uni-card-header">
					<view>{{item.create_time}}</view>
					<view class="text-danger">{{item.status_text}}</view>
				</view>
				<view class="uni-card-content">
					<view class="uni-card-content-inner text-gray">
						<view>提现金额：{{item.amount}}</view>
						<view>手续费：{{item.fees}}</view>
						<view>帐号类型：{{item.account_type}}</view>
						<view>收款人：{{item.account_name}}</view>
						<view>收款帐号: {{item.account_no}}</view>

						<view v-if="item.handle_time">处理时间：{{item.handle_time}}</view>
						<view v-if="item.remark">备注：{{item.remark}}</view>
					</view>
				</view>
				
			</view>
		</view>
		
		<view class="no-data" v-else>你还没有提现记录</view>
		
		<navigator url="withdraw" class="fixed-bottom-btn">申请提现</navigator>
	</view>
</template>

<script>
	import Request from '../../common/request.js';
	
	export default {
		data() {
			return {
				list: [],
				page: 1,
				nextPage: true,
			};
		},
		onShow() {
			this.getList();
		},
		onReachBottom() {
			this.getList();
		},
		methods: {
			getList() {
				if(this.nextPage == false){
					return false;
				}
				
				var that = this;
				Request.send({
					url: 'funds/withdrawRecord',
					data: {
						page: that.page
					},
					sCallback: function(res) {
						that.list = that.list.concat(res.data);
						that.page ++;
						if(res.data.length < 20) {
							that.nextPage = false;
						}
					}
				})
			}
		}
	}
</script>

<style>
	.withdraw{
		margin-bottom: 100upx;
	}
	.withdraw .uni-card-header{
		font-size: 28upx;
	}
	.withdraw .uni-card-content-inner{
		line-height: 50upx;
	}
</style>
